<template>
  <div class="wrap">
    <div class="top">
      <div class="pledgee-name">
        <span>变更商标代理人/文件接收人申请书</span>
      </div>

      <div class="pledgee-msg">
        <div class="top-left">
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">申请人名义（中文）：</span>
              <el-input v-if="control" v-model="appNameCn" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{appNameCn}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">（英文）：</span>
              <el-input v-if="control" v-model="appNameEn" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{appNameEn}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">申请人地址（中文）：</span>
              <el-input v-if="control" v-model=" appAddCn" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{appAddCn}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">（英文）：</span>
              <el-input v-if="control" v-model=" appAddEn" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{ appAddEn}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">邮政编码 ：</span>
              <el-input v-if="control" v-model="postCode" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{postCode}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">联系人 ：</span>
              <el-input v-if="control" v-model="contacts" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{contacts}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">邮箱 ：</span>
              <el-input v-if="control" v-model="emailpp" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{emailpp}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">电话 ：</span>
              <el-input v-if="control" v-model="phone" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{phone}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">代理机构名称 ：</span>
              <el-input v-if="control" v-model="ageName" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{ageName}}</span>
            </div>
          </div>
          <!-- <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">变更后代理机构名称 ：</span>
              <el-input v-if="control" v-model="ageName" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{ageName}}</span>
             
            </div>
          </div>-->
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">变更后文件接收人名称 ：</span>
              <el-input v-if="control" v-model="name_receiver" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{name_receiver}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">变更后文件接收人地址 ：</span>
              <el-input v-if="control" v-model="addr_receiver" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{addr_receiver}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">变更后邮政编码 ：</span>
              <el-input v-if="control" v-model="rec_code_postal" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{rec_code_postal}}</span>
            </div>
          </div>
          <div class="showimg">
            <div class="follower-list folloerstyle back" v-if="iddbimage">
              <span>变更后身份证正反面：</span>
              <div>
                <imgshow>
                  <img :src="mconfig.host+iddbimage" alt />
                </imgshow>
              </div>
            </div>
          </div>
          <div class="showimg">
            <div class="follower-list folloerstyle back" v-if="bussimg" style="margin-left:-81px">
              <span v-if="chtype==9">变更后其它证件：</span>
              <span v-else>接收人营业执照：</span>
              <div>
                <imgshow>
                  <img :src="mconfig.host+bussimg" alt style="margin-left:-3px" />
                </imgshow>
              </div>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">商标申请号/注册号 ：</span>
              <el-input v-if="control" v-model="appNum" placeholder="请输入内容"></el-input>
              <span class="parallelism" v-else>{{appNum}}</span>
            </div>
          </div>
          <div class="form-menu">
            <div class="form-menu-left">
              <span class="form-menu-text">是否共有商标 ：</span>
              <div v-if="control" style="width:100%;padding-left:30px">
                <el-radio v-model="isComm" :label="1">是</el-radio>
                <el-radio v-model="isComm" :label="0">否</el-radio>
              </div>
              <span class="parallelism" v-else>
                <span>
                  <span v-if="vister">是</span>
                </span>

                <span>
                  <span v-if="visfals">否</span>
                </span>
              </span>
            </div>
          </div>
          <!-- <div class="form-menu" style="margin-top:150px">
            <div class="stamp">申请人章戳（签字）：</div>
            <div class="stamp">代理机构章戳：</div>
          </div>-->
          <div>
            <!-- <div class="form-menu">
              <span
                style="width:200px;text-align:right;color:rgb(104,104,104);font-size:15px"
              >注：请按说明填写</span>
            </div>
             <div class="form-menu">
              <div class="agent">代理人签字：</div>
            </div>-->
          </div>
        </div>
      </div>
    </div>
    <!-- 照片展示 -->
    <div class="showimg">
      <div class="follower-list folloerstyle" style="margin-left:-47px">
        <span>营业执照 ：</span>
        <div>
          <imgshow>
            <img :src="mconfig.host+busimg" alt style="margin-left:-20px"/>
          </imgshow>
        </div>
      </div>
      <div class="follower-list showidimg" v-show="visit" style="margin-left:-55px">
        <span>身份证正反面 ：</span>
        <div>
          <imgshow>
            <img :src="mconfig.host+idcardimg" alt />
          </imgshow>
        </div>
      </div>
      <!-- 网上确认书 -->
      <div class="follower-list style"  style="margin-left:-45px;margin-top:10px">
        <span>网上确认书 ：</span>
        <div>
          <imgshow>
            <img :src="mconfig.host+sureqr" alt style="margin-left:15px"/>
          </imgshow>
        </div>
      </div>
      <!--<div class="follower-list style"  style="margin-left:-45px;margin-top:10px" v-if="otherfile != []">-->
      <div class="follower-list style"  style="margin-left:-45px;margin-top:10px" v-if="otherfile.length>0">
        <span>其他附件 ：</span>
        <div>
          <imgshow v-for="(item,index) in otherfile" :key="index">
            <img :src="mconfig.host+item" alt style="margin-left:15px"/>
          </imgshow>
        </div>
      </div>
    </div>

    <div v-if="proAppendJson.length" class="follower">
      <div class="follower-title">
        <div>
          <div class="text-align: right;" style="margin-left:-40px">变更商标代理人/文件接收人申请书</div>
          <div class="text-align: center;">（附页）</div>
        </div>
        <span class="follower-title-text">其他共有人</span>
      </div>

      <div class="follower-matter">
        <div class="follower-matter-frame" v-for="(mat,ter) in proAppendJson" :key="ter">
          <div class="follower-matter-box">
            <div class="follower-list">
              <span class="follower-matter-text">{{ter+1}}. 名称（中文）：</span>
              <span>{{mat.partNameCh}}</span>
            </div>
            <div class="follower-list">
              <span class="follower-matter-text">名称（英文）：</span>
              <span>{{mat.partNameEn}}</span>
            </div>
            <div class="follower-list">
              <span class="follower-matter-text">地址（中文）：</span>
              <span>{{mat.partAddrCh}}</span>
            </div>
            <div class="follower-list">
              <span class="follower-matter-text">地址（英文）：</span>
              <span>{{mat.partAddrEn}}</span>
            </div>
            <!-- 其他共有人营业执照 -->
            <div class="follower-list newaddimg">
              <span class="follower-matter-text">营业执照：</span>
              <imgshow>
                <img :src="mconfig.host+proAppendJson[0].busimg" alt />
              </imgshow>
            </div>
            <!-- 其他共有人身份证 -->
            <div class="follower-list newaddimg">
              <span class="follower-matter-text">身份证：</span>
              <imgshow>
                <img :src="mconfig.host+proAppendJson[0].idcardimg" alt />
              </imgshow>
            </div>
          </div>
        </div>
        <div class="seal">（戳章/签字）</div>
      </div>
    </div>

    <!-- <div class="botton" style="width:100%;text-align:center;padding:15px 0;">
            <a class="buttona" href="javascript:;" @click="submit()">提交</a>
    </div>-->

    <!-- <div class="amend-btn">
          <a class="buttona" href="javascript:;" @click="notarizeAmend">确认修改</a>
    </div>-->
  </div>
</template>

<script>
import imgshow from "../common/imgshow";
export default {
  components: {
    imgshow,
  },
  data() {
    return {
      appNameCn: "", //   申请人名称（中文）
      appNameEn: "", //   申请人名称（英文）
      appAddCn: "", //   申请人地址（中文）
      appAddEn: "", //   申请人地址（英文）

      postCode: "", //   邮政编码
      contacts: "", //   联系人
      phone: "", //   电话
      ageName: "", //   代理机构名称
      emailpp: "",
      sureqr: "",
      bussimg:"",
      chtype:"",

      name_agency: "", //   变更后代理机构名称
      name_receiver: "", //   变更后文件接收人名称
      addr_receiver: "", //  变更后文件接收人地址
      rec_code_postal: "", //   变更后邮政编码
      appNum: "", //   商标申请号/注册号
      isComm: "", //   是否共有商标：（是否）
      iddbimage: "", //变更后身份证正反面
      busimg: "",
      idcardimg: "",
      visit: false,
      vister: true,
      visfals: false,
      proAppendJson: [], //   共享人 json
      otherfile:[],

      control: false, //   控制标签的显示
      dialogVisible: false,
    };
  },
  methods: {
    genre() {
      //console.log(this.appliType)
    },
    notarizeAmend() {
      if (this.control) {
        this.control = false;
        //console.log(this.control)
      } else {
        this.control = true;
        //console.log(this.control)
      }
    },

    handleRemove(file) {
      //  上传图片的删除
      //console.log(file);
      this.disabledd = false;
      this.$refs.upload.clearFiles();
    },
    getData() {
      this.$http
        .get("/trademark/proTChAgent/findByIdDetl", {
          params: {
            id: this.$route.query.id,
          },
        })
        .then((response) => {
         
          if (response.data.code == 200) {
            let resAppend = response.data.data.append;
            let resData = response.data.data.data;

            this.appNameCn = resData.appName; //   申请人名称（中文）
            this.appNameEn = resData.appNameEn; //   申请人名称（英文）
            this.appAddCn = resData.busAddress; //   申请人地址（中文）
            this.appAddEn = resData.appAddEn; //   申请人地址（英文）

            this.postCode = resData.postCode; //   邮政编码
            this.contacts = resData.contacts; //   联系人
            this.phone = resData.phone; //   电话
            this.ageName = resData.deptName; //   代理机构名称
            this.emailpp = resData.email;
            this.sureqr = resData.qrfile;
            this.bussimg = resData.bussimg;
            this.chtype = resData.chtype;

            this.name_agency = resData.nameAgency; //   变更后代理机构名称
            this.name_receiver = resData.nameReceiver; //   变更后文件接收人名称
            this.addr_receiver = resData.addrReceiver; //  变更后文件接收人地址
            this.rec_code_postal = resData.recCodePostal; //   变更后邮政编码
            this.iddbimage = resData.iddbimage;
            this.appNum = resData.appCode; //   商标申请号/注册号
            this.isComm = JSON.parse(resData.commStatus); //   是否共有商标：（是否）
            this.otherfile = JSON.parse(resData.otherfile);

            if (this.isComm == 1) {
              (this.vister = true), (this.visfals = false);
            } else {
              (this.vister = false), (this.visfals = true);
            }
            // 共有人...
            this.proAppendJson = resAppend;
            console.log(this.proAppendJson);
            this.busimg = resData.busimg;
            this.idcardimg = resData.idcardimg;
            if (this.idcardimg.length > 0) {
              this.visit = true;
            } else {
              this.visit = false;
            }
          }
        })
        .catch((error) => {});
    },
  },

  mounted() {
    this.getData();
  },
};
</script>


<style scoped>
body,
div,
a,
p,
span,
ul,
li {
  padding: 0;
  margin: 0;
}
div {
  box-sizing: border-box;
}
img {
  max-width: 100%;
  max-height: 100%;
}
a {
  text-decoration: none;
}
.wrap {
  padding: 20px 20px;
  position: relative;
}
.amend-btn {
  position: absolute;
  top: 8%;
  right: 10%;
}
.buttona {
  color: #fff;
  padding: 8px 15px;
  border-radius: 5px;
  background: rgba(0, 0, 255, 0.5);
}
.buttona:hover {
  background: rgba(0, 0, 255, 0.8);
}
.top {
  /* 质权人信息部分  */
  min-width: 1200px;
  /* margin: 0 auto; */
  padding: 10px 5px;
  /* border: 1px solid blue; */
}
.pledgee-name {
  /* 质权人信息部分整体框架  */
  width: 1000px;
  margin: 20px 0px;
  display: flex;
  justify-content: center;
  font-size: 25px;
}
.pledgee-name span {
  display: inline-block;
  /* width: 1000px; */
  /* border: 1px solid red; */
}
.dashed-text {
  /* 质权人信息部分的标题  */
  font-size: 17px;
  font-weight: bold;
  color: rgb(100, 100, 100);
}
.dashed {
  /* 质权人信息部分的内容  */
  width: 50%;
  margin-left: 10px;
  border-top: 1px dashed rgb(204, 204, 204);
}
.pledgee-msg {
  /* 内容部分的整体框架  */
  width: 100%;

  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-left {
  /* 内容的左边部分  */
  width: 100%;
}
.form-menu {
  /*  每行内容的显示  */
  width: 1150px;
  display: flex;
  flex-direction: row;

  /* padding: 5px 80px 5px 50px;
  padding: 8px 0; */
}
.form-menu-left {
  width: 60%;
  display: flex;
  margin: 0 auto;
  flex-direction: row;
  /* border: 1px solid red; */
  align-items: center;
}
.form-menu-right {
  width: 40%;
  display: flex;
  flex-direction: row;
  align-items: center;
}
.form-menu-text {
  /*  每行内容文本的css样式的显示  */
  width: 320px;
  font-size: 13px;
  text-align: right;
  margin-right: 25px;
  /* padding-top: 10px; */
  /* color: rgb(140, 140, 140); */
  /* border: 1px solid red; */
}
.parallelism {
  width: 100%;
  padding: 6px 0;
}
.el-input /deep/ .el-input__inner {
  color: #000;
  height: 38px;
}

.el-select {
  width: 700px;
}
.el-select-dropdown__item {
  padding-left: 20px;
}

/* 新版本样式 */
.stamp {
  width: 30%;
  height: 250px;
  font-size: 15px;
  text-align: center;
  /* border: 1px solid red; */
}
.agent {
  width: 100%;
  text-align: right;
  margin-right: 25%;
}
.follower {
  /* width: 1125px; */
  padding: 50px 0 0 0;
}
.follower-title {
  /* font-weight: bold; */
  width: 600px;
  margin-left: 300px;
  font-size: 20px;
}
.follower-title div {
  /* width: 500px; */
  margin-left: 14%;
  /* border: 1px solid red; */
}
.follower-title-text {
  margin-left: 19%;
  font-size: 16px;
  font-weight: normal;
  display: inline-block;
  padding: 20px 0 15px 0;
}
.follower-matter-frame {
  /* display: flex;
  justify-content: space-around;
  align-items: center; */
  width: 600px;
  margin-left: 300px;
  padding-right: 15%;
  /* border: 1px solid red; */
  margin-bottom: 60px;
}
.seal {
  width: 200px;
  color: rgb(104, 104, 104);
  position: absolute;
  /* border: 1px solid red; */
  right: 100px;
  bottom: 30px;
}
.follower-matter-box {
  margin-left: 52px;
  /* border: 1px solid red; */
}
.follower-matter-text {
  display: inline-block;
  width: 200px;
  margin: 0 auto;
  margin-right: 25px;
  font-size: 15px;
  text-align: right;
  padding: 4px 0px;
}
.follower-list {
  margin-left: -112px;
}
.folloerstyle {
  width: 300px;

  display: flex;
  justify-content: space-around;
  margin: 0px;
  margin-left: -34px;
  margin-bottom: 20px;
}
.style {
  width: 250px;

  display: flex;
  justify-content: space-around;
  margin: 0px;
  margin-left: -28px;
  margin-bottom: 20px;
}

.folloerstyle img {
  margin-left: 10px;
  width: 500px;
}
.showimg {
  position: relative;
  width: 500px;
  margin-left: 400px;
}
.showidimg {
  margin-top: 10px;
  margin-left: -12px;
  display: flex;
}
.showidimg img {
  margin-left: 20px;
}
.newaddimg {
  width: 250px;
  display: flex;
  justify-content: space-around;
  margin-left: 12px;
  margin: 10px 12px;
}
.back{
  margin-left: -101px;
}
</style>